/*
 / _____)             _              | |
( (____  _____ ____ _| |_ _____  ____| |__
 \____ \| ___ |    (_   _) ___ |/ ___)  _ \
 _____) ) ____| | | || |_| ____( (___| | | |
(______/|_____)_|_|_| \__)_____)\____)_| |_|
    (C)2015 Semtech

Description: End device commissioning parameters

License: Revised BSD License, see LICENSE.TXT file include in the project

Maintainer: Miguel Luis and Gregory Cristian
*/

/*
 * Copyright (C) 2015-2017 Alibaba Group Holding Limited
 */

#ifndef __LORA_COMMISSIONING_H__
#define __LORA_COMMISSIONING_H__

#ifdef __cplusplus
extern "C" {
#endif

/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* External variables --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
/**
 * When set to 1 the application uses the Over-the-Air activation procedure
 * When set to 0 the application uses the Personalization activation procedure
 */
#define OVER_THE_AIR_ACTIVATION                     1

/**
 * Indicates if the end-device is to be connected to a private or public network
 */
#define LORAWAN_PUBLIC_NETWORK                      true

/**
 * When set to 1 DevEui is LORAWAN_DEVICE_EUI
 * When set to 0 DevEui is automatically generated by calling
 *         BoardGetUniqueId function
 */
#define STATIC_DEVICE_EUI                     1

/**
 *
DEVEUI:d896 e0ff 0000 0231
APPEUI:d896 e0e0 0000 7fda
APPKEY:cc6b fe7e 799c 5463 b9af 3c32 35c9 4303

ASR:
DevEUI d896 e0ff 0000 023b   
AppKey 8133 6BE0 90A2 C6AA DA13 F9D4 F2E4 7B16  
joineui D896 E0E0 0000 8997
 * Mote device IEEE EUI (big endian)
 *
 * \remark see STATIC_DEVICE_EUI comments
 * 
 */
/*
    asr
    huilian
    ali
    asr
    ali(class c)
    ali (inter )
*/
//#define LORAWAN_DEVICE_EUI                          { 0xd8, 0x96, 0xe0, 0xff, 0x00, 0x00, 0x02, 0x3b }
//#define LORAWAN_DEVICE_EUI                          { 0xd8, 0x96, 0xe0, 0xff, 0x00, 0x00, 0x02, 0x31 }
//#define LORAWAN_DEVICE_EUI                          {0xd8, 0x96, 0xe0, 0xff, 0x00, 0x00, 0x02, 0x2a}
#define LORAWAN_DEVICE_EUI                            {0xd8, 0x96, 0xe0, 0xff, 0x00, 0x00, 0x02, 0x40}

//#define LORAWAN_DEVICE_EUI                            {0xD8, 0x96, 0xE0, 0x00, 0x08, 0x00, 0x00, 0x05}
//#define LORAWAN_DEVICE_EUI                          {0xd8, 0x96, 0xe0, 0xff, 0x00, 0x00, 0x02, 0x2d}
//#define LORAWAN_DEVICE_EUI                          {0xd8, 0x96, 0xe0, 0xff, 0x00, 0x01, 0x00, 0x20}

/**
 * Application IEEE EUI (big endian)
 */
//#define LORAWAN_APPLICATION_EUI                     { 0xd8, 0x96, 0xe0, 0xe0, 0x00, 0x00, 0x52, 0x03 }
//#define LORAWAN_APPLICATION_EUI                     { 0xd8, 0x96, 0xe0, 0xe0, 0x00, 0x00, 0x7f, 0xda }
//#define LORAWAN_APPLICATION_EUI                     {0xd8, 0x96, 0xe0, 0xe0, 0x00, 0x00, 0xda, 0xb0}
#define LORAWAN_APPLICATION_EUI                       { 0xd8, 0x96, 0xe0, 0xe0, 0x00, 0x00, 0x52, 0x03}

//#define LORAWAN_APPLICATION_EUI                       { 0xD8, 0x96, 0xE0, 0xE0, 0x00, 0x00, 0x70, 0x9A}
//#define LORAWAN_APPLICATION_EUI                     { 0xd8, 0x96, 0xe0, 0xe0, 0x00, 0x00, 0xda, 0xb0}
//#define LORAWAN_APPLICATION_EUI                     { 0xd8, 0x96, 0xe0, 0xe0, 0x00, 0x00, 0x73, 0x23}

/**
 * AES encryption/decryption cipher application key
 */
//#define LORAWAN_APPLICATION_KEY                     { 0x81, 0x33, 0x6B, 0xE0, 0x90, 0xA2, 0xC6, 0xAA, 0xDA, 0x13, 0xF9, 0xD4, 0xF2, 0xE4, 0x7B, 0x16 }
//#define LORAWAN_APPLICATION_KEY                     { 0xCC, 0x6B, 0xFE, 0x7E, 0x79, 0x9C, 0x54, 0x63, 0xB9, 0xAF, 0x3C, 0x32, 0x35, 0xC9, 0x43, 0x03 }
//#define LORAWAN_APPLICATION_KEY                     {0xDC, 0x61, 0x6E, 0xC9, 0xC0, 0x8E, 0x10, 0xAB, 0x47, 0x61, 0x6A, 0xB0, 0x35, 0x37, 0xA7, 0x53}
#define LORAWAN_APPLICATION_KEY                       {0x07, 0x7e, 0xe4, 0x5c, 0x6e, 0x45, 0x64, 0xd9, 0x6d, 0x76, 0xae, 0x55, 0xaf, 0xd3, 0xaa, 0x89}
//#define LORAWAN_APPLICATION_KEY                       {0x17, 0xFF, 0xC0, 0xEC, 0x0D, 0xDB, 0x5E, 0x9E, 0x04, 0xA1, 0x0F, 0xF0, 0x1F, 0xA2, 0x9F, 0xFD}
//#define LORAWAN_APPLICATION_KEY                       {0x28, 0xE5, 0xC7, 0x78, 0x5A, 0x71, 0x6B, 0x04, 0xE4, 0xC5, 0xCD, 0x86, 0x40, 0xE4, 0xD5, 0x8E}
//#define LORAWAN_APPLICATION_KEY                     {0x55, 0x9f, 0xf8, 0x40, 0x80, 0x88, 0xd9, 0x31, 0x07, 0x1a, 0x0e, 0x75, 0x0a, 0x31, 0x6f, 0x80}
//#define LORAWAN_APPLICATION_KEY                     {0x35, 0xea, 0x36, 0x08, 0x5c, 0x3c, 0x44, 0x92, 0xf1, 0x78, 0xdc, 0x93, 0x44, 0xa9, 0x7b, 0x99}

/**
 * Current network ID
 */
#define LORAWAN_NETWORK_ID                          ( uint32_t )0

/**
 * When set to 1 DevAdd is LORAWAN_DEVICE_ADDRESS
 * When set to 0 DevAdd is automatically generated using
 *         a pseudo random generator seeded with a value derived from
 *         BoardUniqueId value
 */
#define STATIC_DEVICE_ADDRESS                     1
/**
 * Device address on the network (big endian)
 *
 * \remark see STATIC_DEVICE_ADDRESS comments
 */
#define LORAWAN_DEVICE_ADDRESS                      ( uint32_t )0x6672237a

/**
 * AES encryption/decryption cipher network session key
 */
//#define LORAWAN_NWKSKEY                             { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C }
#define LORAWAN_NWKSKEY                             { 0x2E, 0x8C, 0x86, 0x50, 0xB4, 0x04, 0x16, 0x72, 0xBB, 0xB9, 0xA3, 0x99, 0xF2, 0xDE, 0xB4, 0x27 }
/**
 * AES encryption/decryption cipher application session key
 */
//#define LORAWAN_APPSKEY                             { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C }
#define LORAWAN_APPSKEY                             { 0xEF, 0x6D, 0x6E, 0x25, 0x03, 0xF5, 0x7A, 0xE2, 0xFA, 0x15, 0x1C, 0xDA, 0x87, 0x45, 0x5F, 0x18 }

/**
 * Multicast address
 */
#define LORAWAN_MULTICAST_ADDRESS 					0x06344bf2

/**
 * AES encryption/decryption cipher network session key for multicast
 */
#define LORAWAN_MULTICAST_NWKSKEY					{ 0x65, 0xe4, 0x48, 0x3d, 0xe3, 0xa9, 0xce, 0xb1, 0x50, 0xd8, 0x86, 0xf3, 0x61, 0x46, 0x02, 0xb5 }

/**
 * AES encryption/decryption cipher application session key for multicast
 */
#define LORAWAN_MULTICAST_APPSKEY					{ 0xc2, 0x65, 0x67, 0xa3, 0xec, 0xd3, 0x96, 0x67, 0xd6, 0x23, 0xf8, 0x7a, 0xe1, 0x6c, 0x12, 0x23 }


#ifdef __cplusplus
}
#endif

#endif /* __LORA_COMMISSIONING_H__ */
